<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      div {
        height: 200px;
        overflow: auto;
      }
      p {
        height: 45px;
        border: 1px solid red;
      }
      .container {
        width: 100px;
        height: 40px;
        margin: 50px auto;
      }
    </style>
  </head>
  <body>
    <!-- <input type="file" accept="image/png,image/jpeg,image/jpg" />
    <button id="btn">点击上传</button> -->\
    <textarea id="tt" rows="6"></textarea>
    <div class="container">
      <input type="text" value="12312">
    </div>
    <div id="demo">
      <p>1</p>
      <p>1</p>
      <p>1</p>
      <p>1</p>
      <p>1</p>
      <p>1</p>
      <p>1</p>
      <p>1</p>
      <p>1</p>
      <p>1</p>
    </div>
    <script>
      demo.addEventListener('scroll', (e) => {
        console.log(e);
      })
      // btn.onclick = () => {
      //   console.log(222);
      //   const a = document.createElement('input');
      //   a.type = 'file'; // 设置类型
      //   a.accept = 'image/png,image/jpeg,image/jpg'; // 设置可接收类型
      //   a.multiple = true; // 多选
      //   document.documentElement.append(a);
      //   a.click();
      //   a.onchange = (e) => {
      //     console.log(e);
      //     a.remove();
      //   };
      // };

      const t = document.getElementById('tt');
      console.log(t);
      t.addEventListener('input', (e) => {
        console.log('input')
        console.log(e);
      })
      t.addEventListener('change', (e) => {
        console.log('change')
        console.log(e);
      })
    </script>
  </body>
</html>
